createAsync

Create a new Handler whose posted messages and runnables are not subject to synchronization barriers such as display vsync.

Messages sent to an async handler are guaranteed to be ordered with respect to one another, but not necessarily with respect to messages from other Handlers.

Return

a new async Handler instance

Parameters

looper

the Looper that the new Handler should be bound to

See also


Create a new Handler whose posted messages and runnables are not subject to synchronization barriers such as display vsync.

Messages sent to an async handler are guaranteed to be ordered with respect to one another, but not necessarily with respect to messages from other Handlers.

Return

a new async Handler instance

Parameters

looper

the Looper that the new Handler should be bound to

callback

callback to send events to

See also

to create an async Handler without custom message handling. Compatibility behavior:

  • SDK 28 and above, this method matches platform behavior.
  • SDK 27 and earlier, this method attempts to call the platform API via reflection, but may fail and return a synchronous handler instance.